package io.test;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class TransCode {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("src/io/test/note.txt");
        InputStreamReader isr = new InputStreamReader(fis,"GBK");
        BufferedReader br = new BufferedReader(isr);
        String d;
        FileOutputStream fos = new FileOutputStream("src/io/test/note_utf.txt");//字节流
        OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);//转换流
        BufferedWriter bw = new BufferedWriter(osw);//缓冲流
        PrintWriter pw = new PrintWriter(bw);
        while ((d = br.readLine()) != null){
            System.out.println(d);
            pw.println(d);
        }
        br.close();
        pw.close();
    }
}
